package cn.mymall.service.impl;

import cn.mymall.redis.RedisHelper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;

public class BaseServiceImpl<M extends BaseMapper<T>, T> extends ServiceImpl<M,T> {
	protected Logger logger = LoggerFactory.getLogger(this.getClass());
	@Autowired
	protected JdbcTemplate jdbcTemplate;
	@Autowired
	protected RedisHelper redisHelper;

	public Integer queryCountBySQLRowsRange(final String sql, final Object... params) {
		Integer count = jdbcTemplate.queryForObject(sql, Integer.class, params);
		return count;
	}
}
